#include <iostream>
#include <algorithm>
using namespace std;
const int N = 1e5 + 10;
using ll = long long;
ll a[3 * N];

int main(){

    int n; cin >> n;
    for (int i = 1; i <= 3 * n; i++){
        cin >> a[i];
    }
    std::sort(a + 1, a + 3 * n + 1);

    ll sum = 0;
    int count = 0;
    for (int i = 3 * n - 1; i >= 1; i -= 2){
        if (count == n) break;
        sum += a[i];
        count ++;
    }

    cout << sum << endl;
    return 0;
}